﻿<!DOCTYPE html>
<html>
	<head>
		<title>TEXTBEFORE Function</title>
		<meta charset="utf-8" />
		<meta name="description" content="" />
		<link type="text/css" rel="stylesheet" href="../../../../../../common/main/resources/help/editor.css" />
		<link type = "text/css" rel = "stylesheet" href = "../../images/sprite.css" />
        <script type="text/javascript" src="../callback.js"></script>
        <script type="text/javascript" src="../search/js/page-search.js"></script>
	</head>
	<body>
		<div class="mainpart">
			<div class="search-field">
				<input id="search" class="searchBar" placeholder="Search" type="text" onkeypress="doSearch(event)">
			</div>
			<h1>TEXTBEFORE Function</h1>
			<p>The <b>TEXTBEFORE</b> function is one of the <a href="../UsageInstructions/InsertFunction.htm#textdata" onclick="onhyperlinkclick(this)">text and data functions</a>. It is used to return text occurring before delimiting characters.</p>
			<h3>Syntax</h3>
			<p><b><em>TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])</em></b></p>
			<p>The <b>TEXTBEFORE</b> function has the following argument:</p>
			<table style="width: 40%">
				<tr>
					<th style="background-color: #f4f4f4" width="150ch"><b>Argument</b></th>
					<th style="background-color: #f4f4f4"><b>Description</b></th>
				</tr>
				<tr>
					<td><b><em>text</em></b></td>
					<td>The text the search is conducted within. Wildcard characters are not allowed. If <b>text</b> is an empty string, the function returns empty text.</td>
				</tr>
				<tr>
					<td><b><em>delimiter</em></b></td>
					<td>The text that marks the point before which the function extracts the text.</td>
				</tr>
				<tr>
					<td><b><em>instance_num</em></b></td>
					<td>An optional argument. The instance of the delimiter before which the function extracts the text. By default, <b>instance_num</b> equals <b>1</b>. A negative number will start the text search from the end.</td>
				</tr>
				<tr>
					<td><b><em>match_mode</em></b></td>
					<td>An optional argument. It is used to determine whether the text search is case-sensitive. The default is case-sensitive. The following values are used: <b>0</b> for case sensitive, <b>1</b> for case insensitive.</td>
				</tr>
				<tr>
					<td><b><em>match_end</em></b></td>
					<td>An optional argument. It treats the end of text as a delimiter. By default, the text is an exact match. The following values are used: <b>0</b> for <b><em>not</em></b> matching the delimiter against the end of the text, <b>1</b> for matching the delimiter against the end of the text.</td>
				</tr>
				<tr>
					<td><b><em>if_not_found</em></b></td>
					<td>An optional argument. It sets a value that is returned if no match is found.</td>
				</tr>
			</table>
			<h3>Notes</h3>
            <p><a href="../UsageInstructions/InsertFunction.htm#applyfunction" onclick="onhyperlinkclick(this)">How to apply</a> the <b>TEXTBEFORE</b> function.</p>
			
			<h3>Examples</h3>
            <p>The figure below displays the result returned by the <b>TEXTBEFORE</b> function.</p>
			<p><img alt="TEXTBEFORE Function" src="../images/textbefore.png" /></p>
		</div>
	</body>
</html>